<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看题目信息 </title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/css/font-awesome.min93e3.css">
    <link rel="stylesheet" type="text/css" href="/static/css/admin.css">
</head>
<body>
<div style="padding: 15px;">
    <div style="width: 50%;float: left">
        <h4 class="tm"><b>题目：</b><%--【ID:9349】这属于哪一类标志 --%></h4>
    </div>
    <div class="timu_yuyin"><span style="margin-right:23px;font-size: 18px">播放语音读题</span>
        <%--<audio src="/upload/music/9349.mp3" preload controls></audio>--%>
    </div>
    <div class="timuan">
        <div style="width: 50%; float: left;">
            <h4><b>选项：</b></h4>
            <ul class="timulist">
                <%--<li>
                    <if condition="$data.optiona neq ''">A：警告标志</if>
                </li>
                <li>
                    <if condition="$data.optionb neq ''">B：禁令标志</if>
                </li>
                <li>
                    <if condition="$data.optionc neq ''">C：指示标志</if>
                </li>
                <li>
                    <if condition="$data.optiond neq ''">D：指路标志</if>
                </li>--%>
            </ul>
        </div>
        <div class="timuimg">
            <%--<img src="/upload/image/9349.png">--%>
        </div>
    </div>
    <h4 class="daan"><b>答案：</b>
        <%--B
        <div class="pull-right"><span style="margin-right:23px;">播放技巧讲解</span>
            <audio src="/upload/music/9349.mp3" preload controls></audio>
        </div>--%>
    </h4>

    <div class="jiqiao">
        <div class="jiqiaomiaoshu">
            <h4><b>技巧描述：</b></h4>
            <%--<span>阿斯捷打卡机塞德里克flak阿萨德卡拉的啦阿斯达斯科拉多附带民事， 萨大姐大撒打算打</span>--%>
        </div>
        <div class="jiqiaoimg">
            <%--<h4><b>技巧图片：</b></h4>
            <img src="/upload/image/9349.png">--%>
        </div>
    </div>

    <div class="used"><h4><b>收录到的套题：</b></h4>
        <%--<span>C1C2 C3C4 > 科目四 >   [1]小车科四速成600  > 套题111</span></br>
        <span>C1C2 C3C4 > 科目四 >   [1]小车科四速成600  > 套题111</span></br>
        <span>C1C2 C3C4 > 科目四 >   [1]小车科四速成600  > 套题111</span></br>
        <span>C1C2 C3C4 > 科目四 >   [1]小车科四速成600  > 套题111</span></br>
        <span>C1C2 C3C4 > 科目四 >   [1]小车科四速成600  > 套题111</span></br>
        <span>C1C2 C3C4 > 科目四 >   [1]小车科四速成600  > 套题111</span></br>--%>
    </div>

</div>
</body>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/CheckDaAn.js"></script>
<script>
    var id = location.search.slice(5);
    $.ajax({
        type: 'GET',
        dataType: "json",
        data: {id:id},
        url: '/subjectById',
        success: function (result) {
            var subject = result.data;
            var location = result.location;
            var DaAn=GetSubjectAnswer(subject.answer,subject.type);
            $(".tm").append(subject.problem);
            //语音读题
            if (subject.dmusicpath== undefined){
                $(".timu_yuyin").append($("<div>").append($("<span>").html("暂未添加</br></br></br></br></br>")));
            }else {
                $(".timu_yuyin").append("<audio src="+subject.dmusicpath+"  controls></audio></br></br></br></br></br>");
            }

            if (subject.type===0){  //单选题
                $(".timulist").append($("<li>").append("A："+subject.optiona+"")).append($("<li>").append("B："+subject.optionb+""))
                    .append($("<li>").append("C："+subject.optionc+"")).append($("<li>").append("D："+subject.optiond+""));
                //答案
                $(".daan").append(""+DaAn+"").append("<div class=\"pull-right\"><span style=\"margin-right:23px;\">播放技巧讲解</span></div>");
                //技巧语音讲解
                if (subject.musicpath==undefined){
                    $(".pull-right").append($("<span>").html("暂无技巧讲解语音"));
                }else {
                    $(".pull-right").append("<audio src="+subject.musicpath+"  controls></audio>");
                }
            }else if (subject.type===1){//判断题
                $(".timulist").append($("<li>").append("√")).append($("<li>").append("×"));
                //答案
                $(".daan").append(""+DaAn+"").append("<div class=\"pull-right\"><span style=\"margin-right:23px;\">播放技巧讲解</span></div>");
                //技巧语音讲解
                if (subject.musicpath==undefined){
                    $(".pull-right").append($("<span>").html("暂无技巧讲解语音"));
                }else {
                    $(".pull-right").append("<audio src="+subject.musicpath+"  controls></audio>");
                }
            }else if (subject.type===2){//多选题
                $(".timulist").append($("<li>").append("A："+subject.optiona+"")).append($("<li>").append("B："+subject.optionb+""))
                    .append($("<li>").append("C："+subject.optionc+"")).append($("<li>").append("D："+subject.optiond+""));
                //答案
                $(".daan").append(""+DaAn+"").append("<div class=\"pull-right\"><span style=\"margin-right:23px;\">播放技巧讲解</span></div>");
                //技巧语音讲解
                if (subject.musicpath==undefined){
                    $(".pull-right").append($("<span>").html("暂无技巧讲解语音"));
                }else {
                    $(".pull-right").append("<audio src="+subject.musicpath+"  controls></audio>");
                }
            }
            if (subject.mtype===2){//无媒体类型
                $(".timuimg").append($("<div>").append("<span>").html("暂无媒体文件"));
            }else if (subject.mtype===1){//视频
                $(".timuimg").append("<video width=\"352\" height=\"264\"  autoplay=\"autoplay\" loop=\"loop\" autobuffer=\"\">\n" +
                    "<source src="+subject.mpath+" type=\"video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;\"></video>");
            }else if (subject.mtype===0){//图片
                $(".timuimg").append($("<img>").attr("src",subject.mpath));
            }
            //技巧文字
            if (subject.explain!=""){
                $(".jiqiaomiaoshu").append("<span>"+subject.explain+"</span>");
            }else {
                $(".jiqiaomiaoshu").append("<span>暂未添加技巧描述内容</br></br></br></br></br></span>");
            }
            //技巧媒体
            if (subject.tmpath==undefined){
                $(".jiqiaoimg").append("<h4><b>技巧媒体：</b></h4><span>暂未添加技巧媒体</br></br></br></br></br></span>");
            }else {
                if (subject.tmtype===0){//图片
                    $(".jiqiaoimg").append("<h4><b>技巧图片：</b></h4><img src="+subject.tmpath+">")
                }
                if (subject.tmtype===1){//视频
                    $(".jiqiaoimg").append("<h4><b>技巧视频：</b></h4><video width=\"352\" height=\"264\" autoplay=\"autoplay\" loop=\"loop\" autobuffer=\"\">" +
                        "<source src="+subject.tmpath+" type=\"video/mp4; codecs=&quot;avc1.42E01E, mp4a.40.2&quot;\"></video>\n")
                }
                if (subject.tmtype===2){//无技巧资源
                    $(".jiqiaoimg").append("<h4><b>技巧媒体：</b></h4><span>暂未添加技巧媒体</br></br></br></br></br></span>");
                }
            }

            //收录到的套题位置

            for (var i = 0;i<location.length;i++){
                for (var j = 0;j<location[i].courseVoEnhances.length;j++){
                    for (var k = 0;k<location[i].courseVoEnhances[j].exertypeVos.length;k++){
                        var text = "";
                        for (var h = 0;h<location[i].courseVoEnhances[j].exertypeVos[k].secondTypes.length;h++){
                            text=text + location[i].title+" >> " + location[i].courseVoEnhances[j].name+" >> "+location[i].courseVoEnhances[j].exertypeVos[k].name+" >> "+location[i].courseVoEnhances[j].exertypeVos[k].secondTypes[h].name;
                            /*$(".used").append($("<span>").addClass("taoti").html(location[i].title)).append(" >>");
                            $(".used").append($("<span>").addClass("taoti").html(location[i].courseVoEnhances[j].name)).append(" >>");
                            $(".used").append($("<span>").addClass("taoti").html(location[i].courseVoEnhances[j].exertypeVos[k].name)).append(" >>");
                            $(".used").append($("<span>").addClass("taoti").html(location[i].courseVoEnhances[j].exertypeVos[k].secondTypes[h].name)).append("</br>");*/
                        }
                        $(".used").append($("<span class='taoti'>").html(text+"</br>"));
                    }
                }
            }


        }
    })
</script>
</html>